package com.sishu.njrtsdms.domain.core;

import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import lombok.Data;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.LocalDateTime;

@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class BaseEntity {

    /**
     * 创建人(用户名)
     */
    @CreatedBy
    private String createBy;
    /**
     * 创建人(创建时间)
     */
    @CreatedDate
    private LocalDateTime createDateTime;
    /**
     * 修改人(用户名)
     */
    @LastModifiedBy
    private String updateBy;

    @LastModifiedDate
    private LocalDateTime updateDateTime;

    private String remark;


}
